<?php
/**
 * Minhlog 入口文件
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 *
 * @package    project
 * @copyright  Copyright (c) 2009-2010 Minh.Shu@gmail.com
 * @license    New BSD License
 * @author     Minh.Shu
 * @version    $Id: index.php 32 2010-03-30 12:40:08Z minh.shu $
 *
 */
// 定义项目启动时间
define('START_TIME', microtime(true));
// 设置全局缓存(true为开启/false为关闭)
define('CACHE_OPTION', false);
// 设置搜索引擎(Sphinx/Lucene,默认为Lucene)
define('SEARCH_ENGINE', 'Lucene');
// 定义项目路径
defined('APPLICATION_PATH') || define('APPLICATION_PATH',
realpath(dirname(__FILE__) . '/application'));
// 定义项目环境
defined('APPLICATION_ENV') || define('APPLICATION_ENV',
(getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));
// 设置引用路径
set_include_path(
implode(PATH_SEPARATOR,
array(realpath(APPLICATION_PATH . '/../library'), get_include_path())));
// 开启自动加载
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);
// 初始化Zend_Application
$application = new Zend_Application(APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini');
// 会话开始
Zend_Session::start();
// 项目执行
try {
    $application->getBootstrap()->bootstrap(
    array('router', 'frontController'));
    $application->run();
} catch (Exception $e) {
    echo "catch exception: " . get_class($e) . "<br>";
    echo "exception message: " . $e->getMessage() . "<br>";
}